﻿using AOOR.Utilities;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Utilities.Tests
{
    [TestClass]
    public class StringExtensionTests
    {
        readonly string[] strings = { "aa", "ab", "bc", "de" };

        [TestMethod]
        public void StringContainsAnyTest()
        {
            const string str1 = "abcdef";
            const string str2 = "bbdcf";
            const string str3 = "xybbc";

            Assert.IsTrue(str1.ContainsAny(strings));
            Assert.IsFalse(str2.ContainsAny(strings));
            Assert.IsTrue(str3.ContainsAny(strings));
        }

        [TestMethod]
        public void StringContainsAnyCaseSentitiveTest()
        {
            const string str = "ABCDEF";

            Assert.IsFalse(str.ContainsAny(strings));
            Assert.IsTrue(str.ContainsAny(strings, StringComparison.CurrentCultureIgnoreCase));
        }
    }
}
